import {parsePercent, numberHandle} from '~/utils/number';

export const formatTooltip = params => {
    let resultName = '';
    const tooltipList = params.map(chartItem => {
        const {seriesType, seriesName, name, value, data: {ROI}, marker} = chartItem;
        let result;
        resultName = name;
        result = `<br/>${marker}${seriesName}: ${parsePercent(value, 2)}`;

        return result;
    });

    return resultName + tooltipList.join('');
};
